// vuex入口文件 import 名称与 from名称一致
import Vue from 'vue'
import Vuex from 'vuex'
import * as actions from './actions'
import * as getters from './getters'
import state from './state'
import mutations from './mutations'
// 控制台监测 数据变化
import createLogger from 'vuex/dist/logger'

// 注册插件
Vue.use(Vuex);

// vuex调试工具 检测state修改是否是mutatios修改等  存在性能损耗 上线时模式关闭

const debug = process.env.NOOE_ENV !== 'production';


export default new Vuex.Store({
  actions,
  getters,
  state,
  mutations,
  strict: debug,
  plugins: debug ? [createLogger()] : []
})
